﻿#pragma warning disable 649    // disable compiler warnings about unassigned fields

namespace SoftSource.Timecard.Web.Data
{
    using System;
    using System.ComponentModel.DataAnnotations;


    // The MetadataTypeAttribute identifies ProjectMetadata as the class
    // that carries additional metadata for the Project class.
    [MetadataTypeAttribute(typeof(Project.ProjectMetadata))]
    public partial class Project
    {
        internal sealed class ProjectMetadata
        {

            // Metadata classes are not meant to be instantiated.
            private ProjectMetadata()
            {
            }

            public bool ActivelyUsed;

            [Display(Name = "Billed As Of")]
            public Nullable<DateTime> BilledAsOf;

            [Required]
            [Display(Name = "Billing Frequency")]
            public int BillingFrequencyID;

            public DateTime CreationDate;

            public string Description;

            [Required]
            [Display(Name="Estimated Completion Date")]
            public Nullable<DateTime> EstCompletionDate;

            [Required]
            [Display(Name = "Estimated Duration")]
            public Nullable<decimal> EstDuration;

            [Required]
            [Display(Name = "Manager")]
            public Nullable<int> ManagerUserID;

            [Required]
            public string Name;

            [Required]
            [RegularExpression(@"^([A-Z]{3})+-([0-9]{4})+-([0-9]{3})+-SSC$", ErrorMessage = "The Project Code must be in the format of: AAA-####-###-SSC")]
            [Display(Name = "Project Code")]
            public string ProjectCode;

            public int ProjectID;

            [Required]
            [Display(Name = "Project Type")]
            public int ProjectTypeID;

            [Required]
            [Display(Name = "Revenue Type")]
            public int RevenueTypeID;

            [Required]
            [Display(Name = "Status")]
            public int StatusID;
        }
    }
}

#pragma warning restore 649    // re-enable compiler warnings about unassigned fields
